<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style = "width:500px;">
    <div class="modal-content">

      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title">其他运力资源-修改</h4>
      </div>

      <div class="modal-body">
        <form class="form-horizontal ms-form modal-search-form" role="form" method="POST" action="${ctx.host}/suppliers/${supplierId}/trans-vehicle-stat" 
              data-validate="true" data-anchor="#anchor-trasnport-resource">
        
         <input type="hidden" name="_method" value="PATCH">
         <input type="hidden" name=other value="true">
         
           <c:forEach items="${transSupplierVehicleStats}" var="transSupplierVehicleStat" varStatus="count"> 
           <c:if test="${transSupplierVehicleStat.trailerType.code eq 'Two' }">
             <input type="hidden" name="id" value="${transSupplierVehicleStat.id }">
             
             <div class="form-group ms-form-group">
               <label class="control-label col-xs-5 ">${count.index+1}&nbsp;<span class="color-red">*</span>${transSupplierVehicleStat.trailerType.description}（数量）：</label>
               <div class="col-xs-6 pull-left">
                 <input type="text" name="amount" class="form-control" value="${transSupplierVehicleStat.amount }" placeholder="" data-validate="required|number" tabindex="1" autocomplete="off"/>
               </div>
             </div>
           </c:if>
           </c:forEach>
        
        <div class="modal-footer ms-modal-footer">
            <button type="submit" class="btn ms-btn btn-primary">确定</button>
            <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
        </div>

       </form>
      </div>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('select[name="transType"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });
        
        $('.date').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            language: 'zh-CN',
            todayBtn: 'linked',
            startDate: '${today}',
            todayHighlight: true,
            pickerPosition: 'bottom-right',
            minView: 'month'
          });

    })
</script>
